
package com.sfdlJPush.controller.api;

import java.util.Map;

import android.view.View;

import com.sfdlJPush.widget.pulltorefresh.PullToRefreshBase;

public abstract class B5MBasePaggingRequest<K extends B5MBasePaggingResponse<?>> extends B5MBaseRequest<K>
{
    public int pageNo = 1;
    public static int pageSize = 30;

    @SuppressWarnings("rawtypes")
    public B5MBasePaggingRequest(ApiListenrDefaultImpl apiListenrDefaultImpl, View view, PullToRefreshBase pullToRefreshBase)
    {
        super(apiListenrDefaultImpl, view, pullToRefreshBase);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void setApiBody(Map<String, String> map)
    {
        // TODO Auto-generated method stub
        map.put("page", pageNo + "");
        map.put("rows", pageSize + "");
    }

    public int getPageNo()
    {
        return pageNo;
    }

    public void setPageNo(int pageNo)
    {
        this.pageNo = pageNo;
    }

    public int getPageSize()
    {
        return pageSize;
    }

    public void setPageSize(int pageSize)
    {
        this.pageSize = pageSize;
    }

    public void nextPage()
    {
        pageNo++;
    }

    public void firstPage()
    {
        pageNo = 1;
    }

    public boolean isFirstPage()
    {
        return (pageNo == 1);
    }
}
